import request from '@/utils/request'

// 查询机柜列表
export function listCabinet(data) {
  return request({
    url: '/cabinet/list',
    method: 'post',
    data: data
  })
}
//获取机柜数据（字典格式数据）
export function dictList() {
  return request({
    url: '/cabinet/dictList',
    method: 'get'
  })
}

// 查询机柜详细
export function getCabinet(id) {
  return request({
    url: '/cabinet/' + id,
    method: 'get'
  })
}

// 新增机柜
export function addCabinet(data) {
  return request({
    url: '/cabinet',
    method: 'post',
    data: data
  })
}

// 修改机柜
export function updateCabinet(data) {
  return request({
    url: '/cabinet',
    method: 'put',
    data: data
  })
}

// 删除机柜
export function delCabinet(id) {
  return request({
    url: '/cabinet/' + id,
    method: 'delete'
  })
}

// 导出机柜
export function exportCabinet(query) {
  return request({
    url: '/cabinet/export',
    method: 'get',
    params: query
  })
}

// 下载机柜导入模板
export function importTemplate() {
  return request({
    url: '/cabinet/importTemplate',
    method: 'get'
  })
}

// 获取机柜
export function cabinetDictList() {
  return request({
    url: '/cabinet/dictList',
    method: 'get'
  })
}
